body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #222;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.new-version-button {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
}

.remix-warning {
    color: white;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
}

.new-version-button a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.new-version-button:hover {
    background-color: #45a049;
}

.game-container {
    position: relative;
    border: 2px solid #444;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    max-height: 100vh;
    margin-top: 50px;
}

.side-menu {
    width: 100%;
    background-color: #222;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid #444;
}

@media (min-width: 768px) {
    .side-menu {
        width: 150px;
        max-height: 600px;
        border-right: 1px solid #444;
        border-bottom: none;
    }
}

.side-menu::-webkit-scrollbar {
    width: 8px;
}

.side-menu::-webkit-scrollbar-track {
    background: #333;
}

.side-menu::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.side-menu::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.section-title {
    color: #fff;
    font-weight: bold;
    margin: 10px 0 5px 0;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.section-content {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

@media (min-width: 768px) {
    .section-content {
        flex-wrap: nowrap;
        flex-direction: column;
    }
}

canvas {
    display: block;
    background-color: #111;
    touch-action: none;
    max-width: 100vw;
    max-height: calc(100vh - 200px);
}

@media (min-width: 768px) {
    canvas {
        max-height: 100vh;
    }
}

.toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background-color: #333;
}

button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 70px;
    min-height: 36px;
}

button:hover {
    transform: translateY(-2px);
}

button.selected {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

#sand {
    background-color: #e6c588;
    color: #333;
}

#dirt {
    background-color: #8b4513;
    color: white;
}

#water {
    background-color: #4040ff;
    color: white;
}

#lava {
    background-color: #ff4000;
    color: white;
    box-shadow: 0 0 10px #ff4000;
}

#brick {
    background-color: #aa5555;
    color: white;
}

#eraser {
    background-color: #ccc;
    color: #333;
}

#clear {
    background-color: #ff5555;
    color: white;
}

#ant {
    background-color: #8B4513;
    color: white;
}

#fly {
    background-color: #4a235a;
    color: white;
}

#wood {
    background-color: #8B4513;
    color: white;
}

#fire {
    background-color: #FF4500;
    color: white;
    box-shadow: 0 0 5px #FF4500;
}

#ice {
    background-color: #ADD8E6;
    color: #333;
}

#glass {
    background-color: #E0FFFF;
    color: #333;
}

#metal {
    background-color: #A9A9A9;
    color: white;
}

#molten-glass {
    background-color: #FFA07A;
    color: white;
    box-shadow: 0 0 5px #FFA07A;
}

#molten-metal {
    background-color: #CD7F32;
    color: white;
    box-shadow: 0 0 5px #CD7F32;
}

#steak {
    background-color: #8B0000;
    color: white;
}

#grub {
    background-color: #808000;
    color: white;
}

#human {
    background-color: #F5DEB3;
    color: #333;
}

#human-playable {
    background-color: #00BFFF;
    color: white;
    box-shadow: 0 0 5px #00BFFF;
}

#wolf {
    background-color: #808080;
    color: white;
}

#heat-sensor {
    background-color: #ff7f50;
    color: white;
}

#gunpowder {
    background-color: #555555;
    color: white;
}

#c4 {
    background-color: #FF0000;
    color: white;
}

#dust {
    background-color: #8B7355;
    color: white;
}

#pollen {
    background-color: #FFA500;
    color: white;
}

#purple-matter {
    background-color: #8A2BE2;
    color: white;
}

#dragon {
    background-color: #8B0000;
    color: white;
    box-shadow: 0 0 5px #FF4500;
}

#black-hole {
    background-color: #000000;
    color: white;
    box-shadow: 0 0 10px #4B0082;
}

#nebula {
    background-color: #9932CC;
    color: white;
}

#cloud {
    background-color: #FFFFFF;
    color: #333;
}

#rain-cloud {
    background-color: #C0C0C0;
    color: #333;
}

#carbon {
    background-color: #222222;
    color: white;
}

#milk {
    background-color: #FFFFF0;
    color: #333;
}

#clay {
    background-color: #B87333;
    color: white;
}

#star {
    background-color: #FFFF33;
    color: #333;
    box-shadow: 0 0 15px #FFFF33;
}

#gas {
    background-color: #AACCFF;
    color: #333;
}

#mario {
    background-color: #FF0000;
    color: white;
}

#gario {
    background-color: #800080;
    color: white;
}

#meitnerium {
    background-color: #FF00FF;
    color: white;
    box-shadow: 0 0 5px #FF00FF;
}

#cobalt {
    background-color: #0047AB;
    color: white;
}

#iridium {
    background-color: #E5E4E2;
    color: #333;
}

#stone {
    background-color: #7D7D7D;
    color: white;
}

#pause-button {
    background-color: #4CAF50;
    color: white;
}

#pause-button.active {
    background-color: #f44336;
}

#fast-button {
    background-color: #2196F3;
    color: white;
}

#fast-button.active {
    background-color: #FF9800;
}

.toggle-button {
    background-color: #555;
    color: white;
}

.toggle-button.active {
    background-color: #ff7f50;
    color: white;
    box-shadow: 0 0 5px #ff7f50;
}

.size-control {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.size-control label {
    color: white;
    margin-right: 5px;
}
.size-control input {
    width: 70px;
}

#mole {
    background-color: #8B4513;
    color: white;
}

#unknown {
    background: linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #dd00f3);
    color: white;
    animation: rainbow 5s linear infinite;
}

#nitrogen {
    background-color: #87CEFA;
    color: #333;
    box-shadow: 0 0 5px #87CEFA;
}

#nuke {
    background: linear-gradient(45deg, #F7FE2E 25%, #000000 25%, #000000 50%, #F7FE2E 50%, #F7FE2E 75%, #000000 75%);
    background-size: 10px 10px;
    color: white;
    box-shadow: 0 0 10px #F7FE2E;
}

#blood {
    background-color: #8B0000;
    color: white;
}

#sodium {
    background-color: #C0C0C0;
    color: #333;
}

#francium {
    background-color: #B13AFC;
    color: white;
}

#hydrogen {
    background-color: #EEEEFF;
    color: #333;
}

#firework-powder {
    background: linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840);
    color: white;
}

@keyframes rainbow {
    0% { background-position: 0% 80% }
    50% { background-position: 100% 20% }
    100% { background-position: 0% 80% }
}

@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
    }
}